a = 33
b = 44
c = True
d = False

print(a != b)
print(a >= b)
print(a <= b)

# if,elif,else用法
if a == b:
    print('a == b')
elif a > b:
    print('a > b')
else:
    print('a < b')

# and,or,not用法
if a == b and c:
    print('1')
if a == b or c:
    print('2')
if not d:
    print('3')

if -2:
    print('只要不是0，可以当True用')
if not 0:
    print('0可以当False用')
if '1111':
    print('只要不是空字符串，可以当True用')
if not '':
    print('空字符串可以当False用')

# 三元表达式
print('a' if a >= b else 'b')

# while循环
i = 0
while i < 7:
    if i == 3:
        i += 1
        continue
    elif i == 5:
        break
    j = 0
    print(f'i-{i} < 5', end=': ')
    while j < 3:
        print(f'{j} < 3', end=', ')
        j += 1
    print('\n')
    i += 1

# for循环
# range默认从0开始，取前不取后
r = range(10)
print(r)
for i in r:
    if i == 5:
        continue
    print(i, end=' ')
print('')
for i in range(5, 10):
    if i == 8:
        break
    print(i, end=' ')
print('')
# 字符串循环
str = 'asdfjkl'
for i in str:
    print(i, end=' ')
print('')
# 数组循环
arr = [1, 2, 3, 4, 5]
for i in arr:
    print(i, end=' ')
print('')
